package com.deam.imsdk.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.deam.imsdk.dao.ConversationDao;
import com.deam.imsdk.dao.UserDao;

import com.deam.imsdk.greendao.ConversationDaoDao;
import com.deam.imsdk.greendao.UserDaoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig conversationDaoDaoConfig;
    private final DaoConfig userDaoDaoConfig;

    private final ConversationDaoDao conversationDaoDao;
    private final UserDaoDao userDaoDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        conversationDaoDaoConfig = daoConfigMap.get(ConversationDaoDao.class).clone();
        conversationDaoDaoConfig.initIdentityScope(type);

        userDaoDaoConfig = daoConfigMap.get(UserDaoDao.class).clone();
        userDaoDaoConfig.initIdentityScope(type);

        conversationDaoDao = new ConversationDaoDao(conversationDaoDaoConfig, this);
        userDaoDao = new UserDaoDao(userDaoDaoConfig, this);

        registerDao(ConversationDao.class, conversationDaoDao);
        registerDao(UserDao.class, userDaoDao);
    }
    
    public void clear() {
        conversationDaoDaoConfig.clearIdentityScope();
        userDaoDaoConfig.clearIdentityScope();
    }

    public ConversationDaoDao getConversationDaoDao() {
        return conversationDaoDao;
    }

    public UserDaoDao getUserDaoDao() {
        return userDaoDao;
    }

}
